package com.reggie.setmeal.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.reggie.setmeal.dao.SetmealDishMapper;
import com.reggie.setmeal.entity.SetmealDish;
import com.reggie.setmeal.service.SetmealDishService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class SetmealDishServiceImpl extends ServiceImpl<SetmealDishMapper, SetmealDish> implements SetmealDishService {

    @Autowired
    private SetmealDishMapper mapper;


    @Override
    public void deleteByID(Long id) {
//        QueryWrapper<SetmealDish> queryWrapper = new QueryWrapper<>();
//        LambdaQueryWrapper<SetmealDish> lambda = queryWrapper.lambda();

        LambdaQueryWrapper<SetmealDish> wrapper = new LambdaQueryWrapper<>();

        wrapper.eq(SetmealDish::getSetmealId, id);

//        this.removeById(queryWrapper);
        mapper.delete(wrapper);
    }
}